
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生管理-宿管系统</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/basicLayout.css">
</head>
<body>

<!--    头部，用来放导航栏-->
<div id="header">
    <ul>
        <li><a href="${pageContext.request.contextPath}/student/index"> 学生管理</a></li>
        <li><a href="${pageContext.request.contextPath}/class/index"> 班级管理</a></li>
        <li><a href="${pageContext.request.contextPath}/room/index"> 房间管理</a></li>
    </ul>
</div>

<!--子导航栏区域-->
<div id="child">
    <label>学生管理功能</label>
    <ul>

        <li><a href="${pageContext.request.contextPath}/student/add/index">学生入住</a></li>
    </ul>
</div>

<!--主体内容区域-->
<div id="content">
    <div id="search">
        <form action="${pageContext.request.contextPath}/student/query" id="searchForm" method="post">
            <table id="searchTable">
                <tr>
                    <td>姓名：<input type="text" id="userName" name="userName" value=""></td>
                    <td>班级：<input type="text" id="className" name="className" value=""></td>
                    <td>房间：<input type="text" id="roomAddress" name="roomAddress" value=""></td>
                    <td><input type="submit" value="搜索"></td>
                    <td><input type="reset" value="重置"></td>
                </tr>
            </table>
        </form>
    </div>
    <div id="show">
        <table id="showTable">
            <tr>

                <th>学生姓名</th>
                <th>学生性别</th>
                <th>所在班级</th>
                <th>所在房间</th>
                <th>联系电话</th>
                <th></th>
            </tr>
            <c:forEach items="${studentList}" var="stu">
            <tr>
                <td>${stu.studentName}</td>
                <td>
                    <c:if test="${stu.studentSex==0}">
                        女
                    </c:if>
                    <c:if test="${stu.studentSex==1}">
                        男
                    </c:if>

                </td>
                <td>${stu.myClass.className}</td>
                <td>${stu.myRoom.roomAddress}</td>
                <td>${stu.studentPhone}</td>
                <td><a href="<c:url value="/student/info?stuId=${stu.studentId}"/>">详情</a></td>
                <td><a href="<c:url value="/student/changeRoom/index?stuId=${stu.studentId}"/>">换房</a></td>
                <td><a href="<c:url value="/student/delete/execute?stuId=${stu.studentId}"/>">退房</a></td>
            </tr>

            </c:forEach>
        </table>

    </div>
</div>

<!--页脚内容区域-->
<div id="footer">页脚</div>
</body>
</html>